//
//  CustomCellView.m
//  mac1
//
//  Created by 李劭华 on 2021/7/27.
//
#import <Masonry/Masonry.h>
#import "CustomCellView.h"

@implementation CustomCellView
-(instancetype)initWithFrame:(NSRect)frameRect
{
    self = [super initWithFrame:frameRect];
    if (self) {
        [self addSubview:self.picImageView];
        [self.picImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
        [self addSubview:self.titleLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];

    }
    return self;
}
- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
    
    // Drawing code here.
}
-(NSImageView *)picImageView
{
    if (!_picImageView) {
        _picImageView = [[NSImageView alloc]initWithFrame:CGRectZero];
        _picImageView.wantsLayer=YES;
        _picImageView.layer.backgroundColor = [NSColor whiteColor].CGColor;
//        _picImageView.layer.borderWidth =1;
//        _picImageView.layer.borderColor  =[NSColor grayColor].CGColor;

    }
    return _picImageView;
}

-(NSTextField *)titleLab
{
    if (!_titleLab) {
        _titleLab = [[NSTextField alloc]initWithFrame:CGRectZero];
        _titleLab.textColor = [NSColor blackColor];
     }
    return _titleLab;
}
@end
